﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace ConsoleApp1.DbCustom.Models
{
    [Index(nameof(Name), Name = "AK_KEY_2_Sys_Button", IsUnique = true)]
    [Index(nameof(Code), Name = "AK_KEY_3_Sys_Button", IsUnique = true)]
    [Index(nameof(Code), Name = "Index_1")]
    public partial class Sys_Button
    {
        public Sys_Button()
        {
            Sys_ModuleButton = new HashSet<Sys_ModuleButton>();
            Sys_RoleModuleButton = new HashSet<Sys_RoleModuleButton>();
        }

        [Key]
        [StringLength(36)]
        [Unicode(false)]
        public string Id { get; set; } = null!;
        [StringLength(50)]
        public string Name { get; set; } = null!;
        [StringLength(50)]
        [Unicode(false)]
        public string Code { get; set; } = null!;
        public int Sort { get; set; }
        [StringLength(36)]
        [Unicode(false)]
        public string? CreatedBy { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? CreatedTime { get; set; }
        [StringLength(36)]
        [Unicode(false)]
        public string? LastModifiedBy { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? LastModifiedTime { get; set; }

        [InverseProperty("Button")]
        public virtual ICollection<Sys_ModuleButton> Sys_ModuleButton { get; set; }
        [InverseProperty("Button")]
        public virtual ICollection<Sys_RoleModuleButton> Sys_RoleModuleButton { get; set; }
    }
}
